package net.dong.service;

import cn.hutool.bloomfilter.BitMapBloomFilter;
import net.zjitc.SuperApplication;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ContextConfiguration;

/**
 * @Author:Dong
 * @Date: 2024/5/5  12:38
 * @Version 1.0
 */
@ContextConfiguration(classes = SuperApplication.class)
public class BloomFilter {
    @Test
    void demo1() {
        // 初始化
        BitMapBloomFilter filter = new BitMapBloomFilter(10);
        filter.add("123");
        filter.add("abc");
        filter.add("ddd");

        // 查找
        System.out.println("filter.contains(\"abc\") = " + filter.contains("abc"));
    }
}
